import {get, post} from '@/request/useRequest'
import { GridParams, ResponseBody } from '@/api/typing';

export async function list(params: GridParams): Promise<ResponseBody> {
  return get('dataDictionary/list', params);
}
export async function exists(params: object): Promise<ResponseBody> {
  return get('dataDictionary/exists', params);
}
export async function upsert(params: object): Promise<ResponseBody> {
  return post('dataDictionary/upsert', params);
}
export async function deletes(params: []): Promise<ResponseBody> {
  return post('dataDictionary/deletes', params);
}

export async function listDetail(parentId: string): Promise<ResponseBody> {
  return get('dataDictionaryDetail/list', { dataDictionaryId: parentId });
}
export async function existsDetail(params: object): Promise<ResponseBody> {
  return get('dataDictionaryDetail/exists', params);
}
export async function upsertDetail(params: object): Promise<ResponseBody> {
  return post('dataDictionaryDetail/upsert', params);
}
export async function deletesDetail(params: []): Promise<ResponseBody> {
  return post('dataDictionaryDetail/deletes', params);
}
export async function selectDir(code: string): Promise<ResponseBody> {
  return get('dataDictionary/selectDir', { code });
}

